<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/tmpl/jobsearchresults.php
 ^ 
 * Description: template view job search results
 ^ 
 * History:		NONE
 ^ 
 */
 
 defined('_JEXEC') or die('Restricted access');
 global $mainframe;

 $document =& JFactory::getDocument();
 $document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);
// $link = 'index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=resume_searchresults&Itemid='.$this->Itemid;
 $link = 'index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=basicinfo';
?>
<script>
jQuery(document).ready(function() {
	/* for keeping track of what's "open" */
	var activeClass = 'dropdown_detail-active', showingDropdown, showingMenu, showingParent;
	/* hides the current menu */
	var hideMenu = function() {
		if(showingDropdown) {
			showingDropdown.removeClass(activeClass);
			showingMenu.hide();
		}
	};
	
	/* recurse through dropdown menus */
	jQuery('.dropdown_detail').each(function() {
		/* track elements: menu, parent */
		var dropdown_detail = jQuery(this);
		var menu = dropdown_detail.next('div.dropdown_detail-menu'), parent = dropdown_detail.parent();
		/* function that shows THIS menu */
		var showMenu = function() {
			hideMenu();
			showingDropdown = dropdown_detail.addClass('dropdown_detail-active');
			showingMenu = menu.show();
			showingParent = parent;
		};
		/* function to show menu when clicked */
		dropdown_detail.bind('click',function(e) {
			if(e) e.stopPropagation();
			if(e) e.preventDefault();
			showMenu();
		});
		/* function to show menu when someone tabs to the box */
		dropdown_detail.bind('focus',function() {
			showMenu();
		});
	});
	
	/* hide when clicked outside */
	jQuery(document).bind('click',function(e) {
		if(showingParent) {
			var parentElement = showingParent[0];
			if(!jQuery.contains(parentElement,e.target) || !parentElement == e.target) {
				hideMenu();
			}
		}
	});

	jQuery(".submitClassSend").click(function (){
		var comment = jQuery('#submitComment').val();
		alert(comment);
		if (comment == ""){
			jQuery('.anycomment').text('Please input any comment!!!');
			return;	
		}
		jQuery(".submitClassSend").each(function (){		
			jQuery(this).parent().removeClass('displayBlock');
			jQuery(this).parent().addClass('displayNone');
			jQuery(".confirmOk").parent().removeClass('displayNone');
		});
		jQuery.ajax({
            type: 'POST',
            url: "<?php echo JURI::root()?>index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=sentdetail",
            success: function(result) {
				alert("tgest");   
           	} 			
      	});			
	});
	jQuery(".confirmOk").click(function (){		
		hideMenu();		
		jQuery(".confirmOk").each(function (){	
			jQuery(this).parent().removeClass('displayNone');
			jQuery(this).parent().addClass('displayNone');		
			jQuery(".submitClassSend").parent().addClass('displayBlock');
		});	
	});		
});
</script>
<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	<?php echo $this->config['title']; ?></td></tr>
	<tr><td height="25"></td></tr>
	<tr><td class="wrecruitmsg">
		<?php echo $this->config['offline_text']; ?>
	</td></tr>
</table>	
<?php }else{ ?>
<style>
 .basic_title{
 	font-weight: bold;
 	color: #989898;
 }
</style>
<div style="padding: 10px 0 10px 10px;border: 2px solid #e1e1e1">
		<div style="float: left;width: 175px;padding-right: 10px;" class="b-leftcontent">
			<div class="panel-employee">Employee Control Pannel</div>
			<hr style="width: 75%;border:1px solid #fe7613" />
			<?php 
			if (sizeof($this->employerlinks) != 0){				
				echo '<ul>';
				foreach($this->employerlinks as $lnk)	{ ?>
					<li class="b-left-list" <?php /*if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  */?>>
						<a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
					</li>
				<?php }
				echo '</ul>';			
			}
			?>
		</div>
		<div style="float: left;width: 73%">
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<!--<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	
		<?php //echo $this->config['title']; ?>
	</td>
	</tr>
	<tr><td height="23"></td></tr>-->
	<tr><td><table border="0" width="100%" cellpadding="0" cellspacing="0" >
	<tr>
		<?php /*if ($this->config['cur_location'] == 1) {?>
		<td class="curloc" valign="bottom">
			<?php echo JText::_('JS_CUR_LOC'); ?> : <a href="index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=resumesearch&Itemid=<?php echo $this->Itemid; ?>" class="curloclnk"><?php echo JText::_('JS_SEARCH_RESUME'); ?></a> <?php echo JText::_('JS_RESUME_SEARCH_RESULT'); ?>
		</td>
		<?php } */?>
		
		<?php if ($this->canview == 1) {
		if ($this->searchresumeconfig['search_resume_showsave'] == 1) {?>
		<td id="savethis" width="30" align="right">
				<input type="button" class="button" onclick="showsavesearch(1);" value="<?php echo JText::_('JS_SAVE_THIS_SEARCH'); ?>">
		</td>
		<?php } ?>
	</tr>
		<?php if ($this->searchresumeconfig['search_resume_showsave'] == 1) {?>
			<form action="index.php" method="post" name="adminForm" id="adminForm" onsubmit="return myValidate(this);">
			<tr id="savesearch">
				<td colspan="2"> <?php echo JText::_('JS_SEARCH_NAME'); ?> &nbsp;: &nbsp;&nbsp;<input class="inputbox required" type="text" name="searchname" size="20" maxlength="30"  />
				&nbsp;&nbsp;&nbsp;<input type="submit" class="button validate" value="<?php echo JText::_('JS_SAVE'); ?>">
				</td>
			</tr>
			<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
			<input type="hidden" name="task" value="saveresumesearch" />
			</form>	
		<?php }
		} ?>
	</table></td></tr>
	<tr><td>
			<?php 
			/*if (sizeof($this->employerlinks) != 0){
				echo '<div id="toplinks"><ul>';
				foreach($this->employerlinks as $lnk)	{ ?>
					<span <?php if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  ?>>
						<a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
					</span>
				<?php }
				echo '<ul></div>';			
			}*/
			?>
	</td></tr>
<!--	<tr><td height="3"></td></tr>-->
	<tr><td class="<?php //echo $this->theme['heading']; ?>" align="left">		
		<div class="head-title">
			<h2><?php echo JText::_('BASIC_CV_REVIEW'); ?></h2>
		</div>
	
	</td></tr>
	<tr><td height="3"></td></tr>
</table>
<?php $basic = $this->basicinfo;?>
<?php if ($basic){?>
	<div style="padding: 10px;background: #f1f1f1;border: 1px solid #d3d3d3">
		<div style="float: left; width: 49%">
			<table cellpadding="0" cellspacing="10" border="0" width="100%" >
			<tr>
				<td class="basic_title" width="150"><?php echo JText::_('JS_CV_TITLE'); ?></td>
				<td><?php echo $basic->application_title; ?></td>
			</tr>
			<tr>
				<td class="basic_title"><?php echo JText::_('JS_NAME'); ?></td>
				<td><strong><?php 
					echo ($basic->first_name) ? strtoupper($basic->first_name)." ": "";
					echo ($basic->middle_name) ? strtoupper($basic->middle_name)." ": "";
					echo ($basic->last_name) ? strtoupper($basic->last_name)." ": "";  
				?></strong></td>
			</tr>
			<tr>
				<td class="basic_title"><?php echo JText::_('JS_HEIGHTEST_EDUCATION'); ?></td>
				<td><?php 
					echo ($basic->highesteduction) ? $basic->highesteduction : "N/A"; 
				?></td>
			</tr>
			<tr>
				<td class="basic_title"><?php echo JText::_('JS_CAREER_DOMAIN'); ?></td>
				<td><?php 
					echo ($basic->cat_title) ? $basic->cat_title : "N/A"; 
				?></td>
			</tr>
			<tr>
				<td class="basic_title"><?php echo JText::_('JS_EXPECTED_SALARY'); ?></td>
				<td><?php 
					echo ($basic->desired_salary) ? $basic->desired_salary : "N/A"; 
				?></td>
			</tr>
			<tr>
				<td class="basic_title"><?php echo JText::_('JS_DATEPOSTED'); ?></td>
				<td><?php echo date($this->config['date_format'],strtotime($basic->create_date)); ?></td>
			</tr>
			</table>
		</div>
		<div style="float: right;padding-right: 10px;min-width: 40%;text-align: right">
			<div class="wrecruit_resumeimg" style="float: right;width: 100px;height: 98px;border: 1px solid #dfdfdf" >							
                    <?php if($resume->photo != '') { ?>
					<img  src="<?php echo $this->config['data_directory']; ?>/data/jobseeker/resume_<?php echo $resume->id ; ?>/photo/<?php echo $resume->photo ; ?>" width="150px" height="150px" title="picture"  alt="Resume Photo"/>
				<?php } ?>
			</div>
			<div style="clear: both"></div>
			<div style="height: 30px;">&nbsp;</div>
            <div>Add to your candidate list</div>
			<div>
				<?php $link = 'index.php?option=com_wrecruit&c=wrecruit&view=jobseeker&layout=view_resume&vm=3&rd='.$basic->id.'&bd=0&Itemid='.$this->Itemid; ?>
				<div id="menu2"><div class="relative">
					<a href="#"  id="dd2" class="dropdown_detail basicdetail" rel="dropdown_detail2" style="width:170px;"><span><?php echo JText::_('Request for detail'); ?></span></a>
					<div id="dropdown_detail2" class="dropdown_detail-menu">
						<form action="#" >												
						<div style="text-align: left">
							<div style="height: 10px"></div>												
							<div style="float: left;width: 40%;text-align: left;font-weight: bold;color: #FE7613"><h3 style="font-size: 20px"><?php echo JText::_('Request for detail'); ?></h3></div>
							<div style="float: right;width: 59%;padding-top: 6px;"><hr style="border: 2px solid #d7d7d7" /></div>
							<div style="clear: both;height: 10px"></div>
							<div class="displayBlock">
								<div style="height: 25px;font-weight: bold">You are requesting the detail of the CV number: <?php echo $basic->id?></div>
								<div><span style="vertical-align:top;padding-right: 10px;font-weight: bold">Comment:</span><span><textarea name="submitComment" id="submitComment" style="width: 400px;height: 60px"></textarea> </span></div>
								<div style="height: 10px"></div>
								<div style="text-align: right" class="submitClassSend"><span style="padding-right: 20px;color: red" class="anycomment"></span><input class="submitClass" type="button" value="<?php echo JText::_('Send');?>"></div>
							</div>
							<div class="displayNone" style="text-align: center">
								<div style="height: 25px;">Your request has submitted to us.</div>														
								<div style="height: 25px;">We will process your request and return to you in the best time</div>	
								<div class="confirmOk"><input class="submitClass" type="button" value="<?php echo JText::_('OK');?>"></div>																											
							</div>
							<div style="height: 10px"></div>																									
						</div>			
						</form>									
					</div>
				</div></div>
				OR&nbsp;
				<a class="reqestdetail" href="<?php echo $link?>"><strong><?php echo JText::_('view full CV'); ?></strong></a>
			</div>
		</div>
		<div style="clear: both"></div>
	</div>	
	</div>    
    <div style="clear: both"></div>
</div>
<div style="height: 8px">&nbsp;</div>
<?php } ?>
<?php } ?>